package com.unipay.vo.order;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.unipay.common.utils.BaseSearch;
import com.unipay.model.order.OrderInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "Order")
public class OrderQueryVo extends BaseSearch<OrderInfo> {

	@ApiModelProperty(value = "会员id")
	private Long userId;
	
	@ApiModelProperty(value = "订单交易号")
	private String outTradeNo;

	@ApiModelProperty(value = "就诊人id")
	private Long patientId;

	@ApiModelProperty(value = "就诊人")
	private String patientName;

	@ApiModelProperty(value = "医院名称")
	private String keyword;

	@ApiModelProperty(value = "订单状态")
	private String orderStatus;

	@ApiModelProperty(value = "安排日期")
	private String reserveDate;

	@ApiModelProperty(value = "创建时间")
	private String createTimeBegin;
	private String createTimeEnd;

	public QueryWrapper<OrderInfo> buildQueryWrapper(){
		QueryWrapper<OrderInfo> queryWrapper = new QueryWrapper<>();
		notNullLike("hosname", keyword, queryWrapper);
		notNullEq("patient_id", patientId, queryWrapper);
		notNullEq("order_status", orderStatus, queryWrapper);
		notNullge("reserve_date", reserveDate, queryWrapper);
		notNullge("create_time", createTimeBegin, queryWrapper);
		notNullle("create_time", createTimeEnd, queryWrapper);

		return queryWrapper;
	}
}

